package com.cndw.kungfu.model.goods.app;

import java.util.Map;

import com.cndw.kungfu.vo.PlayerReceiveVO;

/**
 * 打开获得各种资源
 * 
 * @author fantadust [9677889@qq.com]
 * @date 2011-9-13 下午3:00:05
 */
public class AppDo137 extends AppBase {

	@Override
	public boolean check() throws Exception {

		return true;
	}

	@Override
	public Map<String, Object> run() throws Exception {

		int valueA = goodsMode.getValueA();
		int valueB = goodsMode.getValueB() * player.getLevel();
		PlayerReceiveVO receive = new PlayerReceiveVO();

		switch (valueA) {
		case 1:// 给银两
			player.alterAsset(valueB);
			receive.put(PlayerReceiveVO.RECEIVE_ASSET, valueB);
			break;
		case 2:// 给经验
			player.alterExp(valueB);
			receive.put(PlayerReceiveVO.RECEIVE_EXP, valueB);
			break;
		default:
			break;
		}
		if (!receive.isEmpty()) {
			msg.put("receive", receive);
		}
		return msg;
	}
}
